home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / misc.swg / 0177_Percentage Status Bar.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  2.1 KB  |  54 lines

  1.  
  2. {$A+,B+,D+,E+,F-,G+,I+,L+,N+,O-,P-,Q-,R-,S+,T-,V+,X+}
  3. {$M 5000,0,0}
  4. Uses dos, crt;
  5. var ctr, dd, cc : integer;
  6.  
  7. Procedure Statbar(fc, bc : char; ft, bk : integer; cn, en, xs, ys : integer;
  8.           tf : boolean);
  9. var percentage : integer;
  10. begin
  11.      percentage := round(cn / en * 100 / 2); {/2 changed for shorter bars.}
  12.      Gotoxy(xs,ys);
  13.      textcolor(ft);
  14.      For Ctr := 1 to percentage do write(fc);
  15.      textcolor(bk);
  16.      For Ctr := 1 to 50 - percentage do write(bc);
  17.      if tf = true then
  18.         begin
  19.              write(#32, percentage * 2,'%');
  20.         end;
  21. end;
  22.  
  23. begin
  24.      textbackground(1); clrscr; textcolor(11);
  25.      gotoxy(1,2); Writeln('    Microsoft Scandisk ');
  26.      gotoxy(5,3); For Ctr := 1 to 70 do Write('─');
  27.      gotoxy(5,23); For Ctr := 1 to 70 do Write('─');
  28.      {the below is in my mtbwin.inc ... you can convert it to gotoxy etc..
  29.      button(5, 21, 15, 9, 5,'< Paused >');
  30.      button(18, 21, 15, 9, 5,'< More Info >');
  31.      button(34, 21, 15, 9, 5,'< Exit >');}
  32.      textcolor(7);
  33.      gotoxy(1,5); Writeln('    ScanDisk is now checking the following areas of drive c:');
  34.      writeln;          {√ X}
  35.      cc := 1;
  36.      {the part that controls the starbar/action(s)... }
  37.      Repeat
  38.            Statbar(#219,#176, 14, 14, cc, 1000, 25, 24, true);
  39.            inc(cc, 1);
  40.            Gotoxy(11, 7); {Pipe('√'); forecolor(7);}
  41.            Case cc of
  42.                 150 : Writeln('    DoubleSpace file header          ');
  43.                 250 : Writeln('    Directory structure              ');
  44.                 330 : Writeln('    File system                      ');
  45.                 430 : Writeln('    DoubleSpace file allocation table');
  46.                 500 : Writeln('    Compression structure            ');
  47.                 750 : Writeln('    Volume signatures                ');
  48.                 850 : Writeln('    Boot sector                      ');
  49.                1000 : Writeln('    Surface scan                     ');
  50.            end;
  51. {           for dd := 1 to 34 do write(#8,#32,#8);}
  52.      until cc = 1000
  53. end.
  54.